package com.common.exception;

import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * @author 大忽悠
 * @create 2022/9/23 22:04
 */
@Configuration
@ConditionalOnClass({ExceptionHandler.class,DuplicateKeyException.class})
public class ExceptionAutoConfiguration {
    @Bean
    public WebExceptionHandler webExceptionHandler(){
        return new WebExceptionHandler();
    }
}
